package cn.hackcloud.mybatis.enums;

public enum EmpStatus {
	LOGIN(100, "在线"), LOGOUT(200, "离线"), REMOVE(300, "用户不存在");
	private Integer code;
	private String msg;

	private EmpStatus(Integer code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public Integer getCode() {
		return code;
	}

	public String getMsg() {
		return msg;
	}

	public static EmpStatus getEmpStatus(Integer code) {
		switch (code) {
		case 100:
			return LOGIN;
		case 200:
			return LOGOUT;
		case 300:
			return REMOVE;
		default:
			return LOGOUT;
		}
	}
}
